package feesmodule;
import feesmodule.converter.JurisdictionServicesConverter;
import feesmodule.domain.JurisdictionServices;
import feesmodule.services.IDataService;
import feesmodule.services.ServicesModule;
import java.util.List;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
/**
 *
 * @author Oleg Bulavitchi
 */
@Path("/jurisdiction/")
@Produces("application/xml")
public class JurisdictionResource
{
    
    @GET
    public JurisdictionServicesConverter getJurisdictionServices(
            @QueryParam("jurisdictionId")
            @DefaultValue("1")
            int jurisdictionId
            )
    {
        IDataService dataService = ServicesModule.getTheInjector().getInstance(IDataService.class);
        List <JurisdictionServices> services = dataService.getServicesForJurisdiction(jurisdictionId);
        JurisdictionServicesConverter converter = new JurisdictionServicesConverter(services);
        return converter;
    }
}
